//index.js
//获取应用实例
const app = getApp()
var w=0;
var l=0;
Page({
  data: {

  },
  onLoad: function () {

  },
  onReady:function(){
    //创建节点选择器
    var query = wx.createSelectorQuery();
    //选择id
    var that = this;
    query.select('.star_parent').boundingClientRect(function (rect) {
      w = rect.width;
      l = rect.left;
    }).exec();
  },
  touchMove:function(e){
    this.startTouched(e.changedTouches[0].pageX);
  },
  touchStar:function(e){
    this.startTouched(e.changedTouches[0].pageX);
  },
  startTouched(curY){
    var per = parseInt((curY - l) / w * 100);
    this.setData({
      per: per
    });
  }
})
